//
//  CoreDataToolHelper.h
//  We_Travel
//
//  Created by lanou3g on 15/12/21.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import <Foundation/Foundation.h>
@class Country;
@class Site;
@class Place;
@class Area;

@interface CoreDataToolHelper : NSObject
//单例
+ (instancetype)shareCoreDataTool;
/**
 *  添加城市,即添加行程
 */
- (void)addTravelCountryName:(NSString *)countryName CountryID:(NSInteger)countryID;
/**
 *  添加地区,即给行程添加地区
 */
- (void)addTravelAreaName:(NSString *)areaName AreaID:(NSInteger)areaID areaDay:(NSInteger)areaDay CountryCount:(NSInteger)count;
/**
 *  删除一个地区
 */
- (void)deleteTravelAreaCount:(NSInteger)areaCount CountryCount:(NSInteger)countryCount;
/**
 *  删除所有地区
 */
- (void)deleteTravelAreaAllCountryCount:(NSInteger)countryCount;
/**
 *  删除一个国家的行程
 */
- (void)deleteTravelCountry:(NSInteger)count;
/**
 *  获取一个国家行程
 */
- (Country *)fetchCountryEntityByCount:(NSInteger)count;
/**
 *  获取一个地区数组行程
 */
- (NSArray *)fetchAreaByCountryCount:(NSInteger)countryCount;
/**
 *  获取一个地区
 */
- (Area *)fetchAreaByCount:(NSInteger)count CountryCount:(NSInteger)countryCount;
/**
 *  获取起始地区
 */
- (Place *)fetchPlaceByCount:(NSInteger)count;
/**
 *  修改起始地区
 */
- (void)changeStartPlace:(NSString *)startPlace StopPlace:(NSString *)stopPlace CountryCount:(NSInteger)count;
//修改开始地区
- (void)changeStartPlace:(NSString *)startPlace CountryCount:(NSInteger)count;
//修改结束地区
- (void)changeStopPlace:(NSString *)stopPlace CountryCount:(NSInteger)count;
//修改开始时间
- (void)changeStartTime:(NSString *)startTime CountryCount:(NSInteger)count;
/**
 *  获取country的所有行程
 */
- (NSArray *)fetchCountry;
/**
 *  添加景点,即给每个地区添加景点
 */
- (void)addTravelSiteName:(NSString *)siteName siteID:(NSInteger)siteID Sitetime:(NSString *)time SiteDay:(NSInteger)siteDay AreaCount:(NSInteger)areaCount CountryCount:(NSInteger)countryCount;
/**
 *  通过day获取site数组
 */
- (NSArray *)fetchSiteDay:(NSInteger)siteDay AreaCount:(NSInteger)areaCount CountryCount:(NSInteger)countryCount;
/**
 *  通过time(am,pm,night)获取site实体数组
 */
- (NSArray *)fetchSiteTime:(NSString *)siteTime SiteDay:(NSInteger)siteDay AreaCount:(NSInteger)areaCount CountryCount:(NSInteger)countryCount;
/**
 *  删除单个site景点
 */
- (void)deleteTravelSiteTime:(NSString *)siteTime SiteCount:(NSInteger)siteCount SiteDay:(NSInteger)siteDay AreaCount:(NSInteger)areaCount CountryCount:(NSInteger)countryCount;
/**
 *  根据siteTime删除满足条件的所有site
 */
- (void)deleteTravelSiteTime:(NSString *)siteTime SiteDay:(NSInteger)siteDay AreaCount:(NSInteger)areaCount CountryCount:(NSInteger)countryCount;
/**
 *  根据siteDay删除满足条件的所有site
 */
- (void)deleteTravelSiteDay:(NSInteger)siteDay AreaCount:(NSInteger)areaCount CountryCount:(NSInteger)countryCount;
/**
 *  给area按name给定的顺序排序
 */
- (void)sortAreaByidArray:(NSMutableArray *)idArray CountryCount:(NSInteger)countryCount;

@end
